<html>
<head>
<SCRIPT type="text/javascript" src="selectFood.js"></SCRIPT>
<SCRIPT type="text/javascript" src="deleteFood.js"></SCRIPT>
</head>
<body>
	<?php
	mysql_connect("localhost","yinch838","yinch838-09")
	or die(`Could not connect: ` . mysql_error());
	 
	
	@mysql_select_db("yinch838") or die(mysql_error());
	
	$que= "SELECT name FROM product";
	$result = mysql_query($que) or die(mysql_error());

	$num=mysql_numrows($result);	
	$i=0;
	
	?>
	
	
	<form action="update.php" method="post">
		choose: <select id ="ffood" name="food" onchange="showData(this.value)">
			
			<?php
			while ($i < $num){
				$line = mysql_fetch_object($result);
				$name = $line->name;
				print "<option value='$name'>$name</option>";
				
			$i++;			
			}
			?>			
			</select><br/>			
		<div id="txtHint"><button type="button" onclick="deleteProduct(ffood.value)">Hello!</button></div>			
	</form>
	
	<br/>
</body>
</html> 
